<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>单向绑定循环</title>
		<script type="text/javascript" src="js/knockout-3.4.0.js" ></script>
	</head>
	<body>
		<h1>使用model对象</h1>
		<div id="_bindDemo">
			数量<span data-bind="text: count"></span>
			<ul id="_bindDemo" data-bind="foreach: items">
				<li data-bind="text: $data"></li>
			</ul>
		</div>
	</body>
	<script type="text/jscript">
		var model = function(){
			var self = this;
			self.items = [1, 2, 3, 4]
			self.count = self.items.length;
		};
		ko.applyBindings(model, document.getElementById('_bindDemo'));
	</script>
</html>
